﻿
using RpcHelper;

using WebSocketGateway.Interface;

namespace WebSocketGateway
{
        internal class GatewayLog
        {
                private static readonly string _DefGroup = "WebSocketGateway";
                internal static void AddErrorLog(ErrorException error,string show)
                {
                        if (error.IsSystemError)
                        {
                                error.SaveLog(show, _DefGroup);
                        }
                }

                internal static void AddErrorLog(ErrorException error, IApiModular modular)
                {
                        new ErrorLog(error, _DefGroup)
                                {
                                        { "Name",modular.ServiceName},
                                        { "Modular",modular.GetType().FullName}
                                }.Save();
                }
        }
}
